<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>登录页面</title>
    <link href="css/style.css" rel="stylesheet" type="text/css"/>
	<script src="js/myJs.js"></script>
	<script>
		//验证提交表单
		function validatePost(){
			if (validateFiled($("userName"),"用户名") == true &&
					validateFiled($("passWord"),"密码")==true &&
					validateFiled($("checkCode"),"验证码")==true) {
				$("loginForm").submit();
			}
		}
	</script>
</head>

<body id="login">
	<form action="LoginServlet?action=login" id="loginForm" method="post">
		<h3>高校疫情防控管理系统</h3>
		<label for="userName"><span>用户名：</span><input id="userName" name="userName" type="text" value="${userName}"/></label>
		<label for="passWord"><span>密码：</span><input id="passWord" name="passWord" type="password"/></label>
		<label for="role">
			<span>身份：</span>
			<select id="role" name="role">
				<option value="admin">管理员</option>
				<option value="teacher">教职工</option>
				<option value="student" selected="selected">学生</option>
			</select>
		</label>
		<label for="checkCode">
			<span>验证码：</span><input id="checkCode" name="checkCode" type="text" style="width: 100px;margin:0 0 0 70px;"/>
			<img id="checkCodeImg" src="CheckCodeServlet" onclick="change()"/>
		</label>
		<div id="button">
			<input id="loginButton" name="loginButton" type="button" class="bt" value="登录" onclick="validatePost()"/>
			<input id="registerButton" name="registerButton" type="button" class="bt" value="注册" onclick="window.open('LoginServlet?action=register')">
		</div>

	</form>
</body>
</html>
